package com.dingxin.ship_together_api.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.dev33.satoken.util.SaResult;
import com.dingxin.ship_together_api.service.WxPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Author: ctj
 * Date: 2023-01-12
 * Time: 14:18
 */
@RestController
@SaCheckLogin
@RequestMapping("pay")
public class PayController {

    @Autowired
    private WxPayService wxPayService;

    @PostMapping("notify")
    @SaIgnore
    public SaResult payNotify(HttpServletRequest request) throws Exception {
        return wxPayService.callback(request);
    }
}
